<!DOCTYPE html>
<html>
<head>
    <title>Maven Helper - 依赖树视图测试</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 20px;
            background-color: #f3f3f3;
            color: #333;
        }
        .container {
            background-color: white;
            border-radius: 5px;
            padding: 20px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        h1 {
            color: #0066cc;
            margin-top: 0;
        }
        .tree-view {
            font-family: monospace;
            margin-top: 20px;
        }
        .root-dep {
            margin-bottom: 15px;
            padding-bottom: 5px;
            border-bottom: 1px solid #ddd;
        }
        .dep {
            margin-left: 20px;
            position: relative;
        }
        .dep:before {
            content: '';
            position: absolute;
            left: -15px;
            top: 8px;
            height: 1px;
            width: 10px;
            background-color: #aaa;
        }
        .dep:after {
            content: '';
            position: absolute;
            left: -15px;
            top: 0;
            bottom: 0;
            width: 1px;
            background-color: #aaa;
        }
        .dep:last-child:after {
            bottom: auto;
            height: 8px;
        }
        .conflict {
            color: #e51400;
            font-weight: bold;
        }
        .group-id {
            color: #0077cc;
        }
        .artifact-id {
            color: #6c6c6c;
        }
        .version {
            color: #008000;
        }
        .scope {
            color: #9c27b0;
            font-style: italic;
        }
        .tab-container {
            margin-top: 20px;
            border-bottom: 1px solid #ddd;
        }
        .tab {
            display: inline-block;
            padding: 8px 16px;
            background-color: #f9f9f9;
            cursor: pointer;
            border: 1px solid #ddd;
            border-bottom: none;
            border-radius: 5px 5px 0 0;
            margin-right: 5px;
        }
        .tab.active {
            background-color: white;
            border-bottom: 1px solid white;
            margin-bottom: -1px;
        }
        .tab-content {
            display: none;
            padding: 20px 0;
        }
        .tab-content.active {
            display: block;
        }
        .emergency-tree {
            padding: 15px;
            background-color: #fff3cd;
            border: 1px solid #ffeeba;
            border-radius: 5px;
            margin-bottom: 20px;
        }
        .summary, .note {
            margin-bottom: 15px;
            padding: 10px;
            background-color: #f8f9fa;
            border-radius: 4px;
        }
        .note {
            background-color: #fff3cd;
            color: #856404;
        }
        .deps-table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }
        .deps-table th, .deps-table td {
            padding: 8px;
            border: 1px solid #dee2e6;
            text-align: left;
        }
        .deps-table th {
            background-color: #f2f2f2;
        }
        .deps-table tr.conflict td {
            background-color: #ffebee;
        }
        .refresh-container {
            text-align: center;
            margin-top: 15px;
        }
        .refresh-btn {
            padding: 8px 16px;
            background-color: #0066cc;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Maven Helper - 依赖树视图测试</h1>
        
        <div class="tab-container">
            <div class="tab active" data-tab="standard-tree">标准树视图</div>
            <div class="tab" data-tab="simple-tree">简化树视图</div>
            <div class="tab" data-tab="emergency-tree">应急树视图</div>
        </div>
        
        <!-- 标准树视图 -->
        <div class="tab-content active" id="standard-tree">
            <div class="tree-view">
                <div class="root-dep">
                    <span class="group-id">org.springframework.boot</span>:<span class="artifact-id">spring-boot-starter</span>:<span class="version">2.5.5</span>
                    <div class="dep">
                        <span class="group-id">org.springframework.boot</span>:<span class="artifact-id">spring-boot</span>:<span class="version">2.5.5</span>
                        <div class="dep">
                            <span class="group-id">org.springframework</span>:<span class="artifact-id">spring-core</span>:<span class="version">5.3.10</span> <span class="scope">(compile)</span>
                        </div>
                    </div>
                    <div class="dep conflict">
                        <span class="group-id">org.springframework</span>:<span class="artifact-id">spring-web</span>:<span class="version">5.3.10</span> <span class="scope">(compile)</span>
                        <div class="dep">
                            <span class="group-id">org.springframework</span>:<span class="artifact-id">spring-beans</span>:<span class="version">5.3.10</span>
                        </div>
                    </div>
                </div>
                <div class="root-dep">
                    <span class="group-id">junit</span>:<span class="artifact-id">junit</span>:<span class="version">4.13.2</span> <span class="scope">(test)</span>
                    <div class="dep">
                        <span class="group-id">org.hamcrest</span>:<span class="artifact-id">hamcrest-core</span>:<span class="version">1.3</span>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 简化树视图 -->
        <div class="tab-content" id="simple-tree">
            <div class="tree-view simple">
                <div class="summary">依赖树总览: 10个依赖, 2个根依赖</div>
                <ul class="root-list">
                    <li class="root-dep">
                        <div class="dep-line">
                            <span class="dep-name">org.springframework.boot:spring-boot-starter</span>
                            <span class="dep-version">2.5.5</span>
                            <span class="dep-scope">compile</span>
                        </div>
                        <div class="dep-children">
                            <ul>
                                <li>org.springframework.boot:spring-boot:2.5.5</li>
                                <li>org.springframework:spring-web:5.3.10 (conflict)</li>
                            </ul>
                        </div>
                    </li>
                    <li class="root-dep">
                        <div class="dep-line">
                            <span class="dep-name">junit:junit</span>
                            <span class="dep-version">4.13.2</span>
                            <span class="dep-scope">test</span>
                        </div>
                        <div class="dep-children">
                            <ul>
                                <li>org.hamcrest:hamcrest-core:1.3</li>
                            </ul>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
        
        <!-- 应急树视图 -->
        <div class="tab-content" id="emergency-tree">
            <div class="emergency-tree">
                <div class="summary">
                    <strong>依赖总览:</strong> 10 个依赖, 
                    2 个根依赖, 
                    1 个冲突
                </div>
                <div class="note">
                    <strong>注意:</strong> 完整依赖树无法显示，仅显示根依赖。
                </div>
                <table class="deps-table">
                    <thead>
                        <tr>
                            <th>GroupId</th>
                            <th>ArtifactId</th>
                            <th>Version</th>
                            <th>Scope</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>org.springframework.boot</td>
                            <td>spring-boot-starter</td>
                            <td>2.5.5</td>
                            <td>compile</td>
                        </tr>
                        <tr class="conflict">
                            <td>junit</td>
                            <td>junit</td>
                            <td>4.13.2</td>
                            <td>test</td>
                        </tr>
                    </tbody>
                </table>
                <div class="refresh-container">
                    <button class="refresh-btn">
                        刷新依赖树
                    </button>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 简单的标签页切换功能
        document.querySelectorAll('.tab').forEach(tab => {
            tab.addEventListener('click', () => {
                // 移除所有活动标签和内容
                document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
                document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active'));
                
                // 添加新活动标签和内容
                tab.classList.add('active');
                document.getElementById(tab.dataset.tab).classList.add('active');
            });
        });
    </script>
</body>
</html>
